import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/views/layout/LayoutView.vue'
import Home from '@/views/home/HomeView.vue'
import Cart from '@/views/cart/CartView.vue'
import Shop from '@/views/shop/ShopView.vue'
import OrderConfirm from '@/views/order/OrderConfirmView.vue'
import Order from '@/views/order/OrderView.vue'
import Address from '@/views/address/AddressView.vue'
import My from '@/views/my/MyView.vue'

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      name: 'layout',
      component: Layout,
      children:[
        {
          path:'/home',
          component:Home,
        },
        {
          path:'/cart',
          component:Cart
        },
        {
          path:'/order',
          component:Order
        },
        {
          path:'/my',
          component:My
        }
      ]
    },
    {
      path:'/shop',
      component:Shop,
    },
    {
      path:'/orderConfirm',
      component:OrderConfirm
    },
    ,
    {
      path:'/address',
      component:Address
    }
  ]
})

export default router
